package com.litxuf.web.filter;

import java.io.IOException;

import javax.servlet.Filter;
import javax.servlet.FilterChain;
import javax.servlet.FilterConfig;
import javax.servlet.ServletException;
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
import javax.servlet.http.HttpServletRequest;

import org.apache.log4j.Logger;

/**
 * 判断是否登录
 * 
 */
public class CharacterEncodingFilter implements Filter {
	Logger logger = Logger.getLogger(this.getClass().getName());

	public void init(FilterConfig arg0) throws ServletException {

	}

	public void doFilter(ServletRequest re, ServletResponse res,
			FilterChain filterChain) throws IOException, ServletException {

		HttpServletRequest request = (HttpServletRequest) re;

		request.setCharacterEncoding("utf-8");

		filterChain.doFilter(re, res);

	}

	public void destroy() {

	}

}
